using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using NUnit.Framework;
using QLNhaSach.BUS;
using QLNhaSach.BUS.DTO;
using QLNhaSach.DAO;

namespace QLNhaSach_UnitTest
{
    [TestFixture]
    public class NhanVienDAO_test
    {
        [Test]
        public void DSNV_test()
        {
            DataTable dt = NhanVienDAO.DSNV();
            int kt = 0;
            int gt = dt.Rows.Count;
            Assert.AreEqual(kt, gt);
        }

        [Test]
        public void DangNhap_test()
        {
            NhanVienDTO nv = new NhanVienDTO();
            nv.UserName = "3";
            nv.PassWord = "1";
            DataTable dt = NhanVienDAO.DangNhap(nv);
            int kt = 1;
            int gt = dt.Rows.Count;
            Assert.AreEqual(kt,gt);
        }

        [Test]
        public void TaoTaiKhoanNV_test()
        {
            DataTable dt = new DataTable();
            dt = NhanVienDAO.DSNV();
            int numberfirst = dt.Rows.Count;
            NhanVienDTO nv = new NhanVienDTO();
            nv.HoTen = "Chien Hung";
            nv.PassWord = "56789";

            NhanVienDAO.TaoTaiKhoanNV(nv);
            dt = NhanVienDAO.DSNV();
            int numberlate = dt.Rows.Count;
            Assert.AreEqual(numberfirst,numberlate);
 
        }
    }
}
